import allure
from selenium.webdriver.common.by import By

from base.webkeys import WebKeys
from locator.allPages_data import *


class FeaturesPage(WebKeys):
    def sms(self):
        # 点击功能tab
        with allure.step("点击功能tab"):
            self.on_click(*the_Features_tab)

        with allure.step("点击发送短信进入编辑短信详情页面"):
            locator = ("xpath", '//*[@id="index"]/div[2]/div/div[1]/div/div[2]/div[2]')
            self.on_click(*locator)

        with allure.step("判断发送短信按钮成功显示"):
            locator = ("xpath", '//*[@id="__nuxt"]/div/div/div[1]/div/button')
            result=self.get_text(*locator)
        return result

    def label(self):
        # 点击功能tab
        with allure.step("点击功能tab"):
            self.on_click(*the_Features_tab)

        with allure.step("判断线下标签成功显示在功能列表里面"):
            locator = ("xpath", '//*[@id="index"]/div[2]/div/div[1]/div/div[1]/div[2]')
            result=self.get_text(*locator)
        return result

